<div class="ibox float-e-margins">
	<div class="ibox-title">
		<h5>基本信息</h5>
		<!--<div ibox-tools></div>-->
	</div>
	<div class="ibox-content">
		<div class="form-group">
			<label class="col-sm-2 control-label"><i class="red_req">*</i>通告类型：</label>
			<div class="col-sm-3 checkbox">
				<label ng-repeat="x in noticeTypes" ng-if="x.value!=''"><input type="radio" ng-model="noticeInfo.noticeType" value="{{x.value}}" name="noticeType" />{{x.text}}</label>
			</div>
		</div>
		<div class="row">
			<div class="form-group col-sm-12">
				<label class="col-lg-2 control-label"><i class="red_req">*</i>通告标题：</label>
				<div class="col-lg-7">
					<input type="text" class="form-control" name="title" ng-model="noticeInfo.title" required />
					<div class="req_mesg" ng-show="horizontal.title.$dirty && horizontal.title.$invalid">
						<span ng-show="horizontal.title.$error.required">通告不能为空</span>
					</div>
				</div>
			</div>
			<div class="form-group col-sm-12" ng-if="noticeInfo.noticeType!='1'">
				<label class="col-lg-2 control-label"><i class="red_req">*</i>通告内容：</label>
				<div class="col-lg-7">

				</div>
				<div class="col-lg-7">
					<summernote type="text" config="summeroptions" id="summernote" class="form-control" name="content" required ng-model="noticeInfo.content" on-image-upload="imageUploadALL(files)" editable="editable" editor="editor" >
					</summernote>
					<div class="req_mesg" ng-show="horizontal.content.$dirty && horizontal.content.$invalid">
						<span ng-show="horizontal.content.$error.required">通告内容不能为空</span>
					</div>
				</div>
				<div class="col-lg-3">
					注意：<br>
					1、消息下发给商户时，通告内容中只能有文字内容。不要在内容中直接添加，图片可在消息图片栏上传。图片大小建议360*720，高度320固定，长度可自适应。代理商无此限制。<br>
					2、链接只能为html链接。代理商消息详情优先显示连接内容，商户消息有连接则跳转详情。
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"><i class="red_req">*</i>跳转带参数：</label>
				<div class="col-sm-10 checkbox">
					<label ng-repeat="x in isWithParamList"><input type="radio" ng-model="noticeInfo.isWithParam" value="{{x.value}}" name="isWithParam" />{{x.text}}</label>
					<span style="margin-left: 60px;color: #999999">
						注：仅支持平台自建的跳转链接，不支持第三方链接
					</span>
				</div>
			</div>
			<div class="form-group col-sm-12">
				<label class="col-lg-2 control-label">链接：</label>
				<div class="col-lg-7">
					<input type="text" class="form-control" name="link" ng-model="noticeInfo.link"/>
				</div>
			</div>
			<div class="form-group col-sm-12">
				<label class="col-lg-2 control-label">
					<span ng-show="noticeInfo.noticeType!='1'">消息图片：</span>
					<span ng-show="noticeInfo.noticeType=='1'"><i class="red_req">*</i>弹窗图片：</span>
				</label>
				<div class="col-lg-7">
					<input type="file" nv-file-select="" uploader="uploaderImg"   multiple  />
					<span style="margin: 3px;color: silver;"><br>(注意:仅支持上传500KB以内，格式为png、jpg的图片)</span>
					<table class="table">
						<tbody>
						<tr ng-repeat="item in uploaderImg.queue">
							<td>
								<strong>{{ item.file.name }}</strong>
								<div ng-show="uploaderImg.isHTML5" ng-thumb="{ file: item._file, height: 100 }"></div>
							</td>
							<td ng-show="uploaderImg.isHTML5" nowrap>{{ item.file.size/1024/1024|number:2 }} MB</td>
							<td ng-show="uploaderImg.isHTML5">
								<div class="progress" style="margin-bottom: 0;">
									<div class="progress-bar" role="progressbar" ng-style="{ 'width': item.progress + '%' }"></div>
								</div>
							</td>
							<td class="text-center">
								<span ng-show="item.isSuccess"><i class="glyphicon glyphicon-ok"></i></span>
								<span ng-show="item.isCancel"><i class="glyphicon glyphicon-ban-circle"></i></span>
								<span ng-show="item.isError"><i class="glyphicon glyphicon-remove"></i></span>
							</td>
							<td nowrap>
								<button type="button" class="btn btn-danger btn-xs" ng-click="item.remove()">
									<span class="glyphicon glyphicon-trash"></span> 删除
								</button>
							</td>
						</tr>
						</tbody>
					</table>
					<div ng-hide="imgFlagHide">
						<input type="button" class="btn btn-primary2" type="button" ng-click='removeImg()' value="清除图片" />
						<div class="col-sm-4" style="padding: 0">
							<img style="max-width: 340px" ng-src="{{noticeInfo.messageImgUrl}}" />
						</div>
					</div>
				</div>
			</div>
			<div class="form-group col-sm-12" ng-if="noticeInfo.noticeType!='1'">
				<label class="col-lg-2 control-label">附件：</label>
				<div class="col-lg-7">

					<input type="file" nv-file-select="" uploader="uploaderFile"  multiple  />

					<table class="table">
						<tbody>
						<tr ng-repeat="item in uploaderFile.queue">
							<td>
								<strong>{{ item.file.name }}</strong>
								<div ng-show="uploaderFile.isHTML5" ng-thumb="{ file: item._file, height: 100 }"></div>
							</td>
							<td ng-show="uploaderFile.isHTML5" nowrap>{{ item.file.size/1024/1024|number:2 }} MB</td>
							<td ng-show="uploaderFile.isHTML5">
								<div class="progress" style="margin-bottom: 0;">
									<div class="progress-bar" role="progressbar" ng-style="{ 'width': item.progress + '%' }"></div>
								</div>
							</td>
							<td class="text-center">
								<span ng-show="item.isSuccess"><i class="glyphicon glyphicon-ok"></i></span>
								<span ng-show="item.isCancel"><i class="glyphicon glyphicon-ban-circle"></i></span>
								<span ng-show="item.isError"><i class="glyphicon glyphicon-remove"></i></span>
							</td>
							<td nowrap>
								<button type="button" class="btn btn-danger btn-xs" ng-click="item.remove()">
									<span class="glyphicon glyphicon-trash"></span> 删除
								</button>
							</td>
						</tr>
						</tbody>
					</table>
					<div ng-hide="fileFlagHide">
						<input type="button" class="btn btn-primary2" type="button" ng-click='removeAnnex()' value="清除附件" />
						<br>
						<div>
							<a href="{{noticeInfo.attachmentUrl}}">{{noticeInfo.attachment}}</a>
						</div>
					</div>
				</div>
			</div>
			<div class="form-group col-sm-12" ng-if="noticeInfo.noticeType!='1'">
				<label class="col-lg-2 control-label">图片标题：</label>
				<div class="col-lg-7">
					<input type="file" nv-file-select="" uploader="uploaderTitleImg" multiple />
					<span style="margin: 3px;color: silver;"><br>(注意:仅支持上传500KB以内，格式为png、jpg的图片,仅弹窗提示时有效。未上传图片时，弹窗显示“通告标题”；已上传时， 弹窗显示“图片标题”。图片大小建议580*145px)</span>
					<table class="table">
						<tbody>
						<tr ng-repeat="item in uploaderTitleImg.queue">
							<td>
								<strong>{{ item.file.name }}</strong>
								<div ng-show="uploaderImg.isHTML5" ng-thumb="{ file: item._file, height: 100 }"></div>
							</td>
							<td ng-show="uploaderTitleImg.isHTML5" nowrap>{{ item.file.size/1024/1024|number:2 }} MB</td>
							<td ng-show="uploaderTitleImg.isHTML5">
								<div class="progress" style="margin-bottom: 0;">
									<div class="progress-bar" role="progressbar" ng-style="{ 'width': item.progress + '%' }"></div>
								</div>
							</td>
							<td class="text-center">
								<span ng-show="item.isSuccess"><i class="glyphicon glyphicon-ok"></i></span>
								<span ng-show="item.isCancel"><i class="glyphicon glyphicon-ban-circle"></i></span>
								<span ng-show="item.isError"><i class="glyphicon glyphicon-remove"></i></span>
							</td>
							<td nowrap>
								<button type="button" class="btn btn-danger btn-xs" ng-click="item.remove()">
									<span class="glyphicon glyphicon-trash"></span> 删除
								</button>
							</td>
						</tr>
						</tbody>
					</table>
					<div ng-hide="titleImgFlagHide">
						<input type="button" class="btn btn-primary2" type="button" ng-click='removeTitleImg()' value="清除图片标题" />
						<div class="col-sm-4" style="padding: 0">
							<img style="max-width: 340px" ng-src="{{noticeInfo.titleImgUrl}}" />
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<div class="ibox float-e-margins">
	<div class="ibox-title">
		<h5>下发对象</h5>
		<!--<div ibox-tools></div>-->
	</div>
	<div class="ibox-content">
		<div class="row">
			<div class="form-group col-sm-12">
				<div class="form-group  col-sm-12">
					<label class="col-lg-2 control-label"><i class="red_req">*</i>下发对象：</label>
					<div class="col-lg-3">
						<select class="form-control" name="sysType" ng-model="noticeInfo.sysType"
								ng-options="x.value as x.text for x in sysType" required></select>
					</div>
					<div class="req_mesg" ng-show="horizontal.sysType.$dirty && horizontal.sysType.$invalid">
						<span ng-show="horizontal.sysType.$error.required">下发对象不能为空</span>
					</div>
				</div>
			</div>
			<div class="form-group col-sm-12" ng-switch on="noticeInfo.sysType">
				<div ng-switch-when="1" class="form-group col-sm-12">
					<div class="form-group">
						<label class="col-lg-2 control-label">指定代理商的商户：</label>
						<div class="col-lg-3">
							<select class="form-control" ng-change="listAgent()" ng-model="baseInfo.agentBusiness"
									ng-options="x.value as x.text for x in agentBusiness">
							</select>
						</div>
					</div>
					<br>
					<div class="form-group" ng-if="baseInfo.agentBusiness==='1'">
						<label class="col-lg-2 control-label">请选择代理商</label>
						<div class="col-lg-4">
							<input type="text" class="form-control" ng-model="query_key" ng-change="listAgent()" placeholder="请输入代理商名称或编号"/>
							<div style="height: 207px" class="gridStyle" ui-grid="agentsGrid" class="grid" ui-grid-resize-columns></div>
						</div>
						<div class="col-lg-4">
							<div style="height: 247px" class="gridStyle" ui-grid="selectAgentsGrid" class="grid" ui-grid-resize-columns></div>
						</div>
					</div>
					<div class="form-group">
						<label class="col-lg-2 control-label">业务产品</label>
						<div class="col-lg-4">
							<div style="height: 207px" class="gridStyle" ui-grid="teamsGrid" ui-grid-selection class="grid" ui-grid-resize-columns></div>
						</div>
						<div class="col-lg-4">
							<div style="height: 207px" class="gridStyle" ui-grid="teamProductsGrid" ui-grid-selection class="grid" ui-grid-resize-columns></div>
						</div>
					</div>
					<div class="form-group">
						<label class="col-lg-2 control-label">指定商户</label>
						<div class="col-lg-2">
							<select class="form-control" name="merScope" ng-model="noticeInfo.merScope" style="width:250px;">
								<option value="0">不限定</option>
								<option value="1">指定</option>
								<option value="2">排除</option>
							</select>
						</div>
						<div class="col-lg-2" ng-show="noticeInfo.ntId!=null && noticeInfo.ntId!='' && noticeInfo.merScope!='0'">
							<a class="btn btn-new" type="button" target="_blank" ui-sref="sys.noticeMerchantSettings({noticeId:noticeInfo.ntId})">范围管理</a>
						</div>
					</div>
				</div>
				<div ng-switch-when="2" class="form-group col-sm-12">
					<div class="form-group">
						<label class="col-lg-2 control-label">指定组织：</label>
						<div class="col-lg-10">
							<div class="col-sm-2" data-ng-repeat="oemType in oemTypes">
								<input type="checkbox" ng-click="oemTypeCheck()" name="oemtypecheck"  ng-checked="oemType.checkedState" value="{{oemType.sysValue}}"/>
								<span ng-bind="oemType.sysName"></span>
							</div>
						</div>
					</div>
					<div class="form-group" ng-show="oemListResult">
						<label class="col-lg-2 control-label">指定品牌：</label>
						<div class="col-lg-10">
							<div class="col-sm-2">
								<input type="checkbox" ng-model="check.oemListCheckFlag" ng-click="oemListCheckAll(check.oemListCheckFlag)" />全选</label>
							</div>
							<div class="col-sm-2" data-ng-repeat="oemList in oemListes">
								<input type="checkbox" name="oemlistcheck"  ng-checked="oemList.checkedState" value="{{oemList.brandCode}}"/>
								<span ng-bind="oemList.brandName"></span>
							</div>
						</div>
					</div>
					<div class="form-group">
						<label class="col-lg-2 control-label">指定代理商：</label>
						<div class="col-lg-7">
							<select class="form-control" ng-model="baseInfo.isAll"
									ng-options="x.value as x.text for x in isAll"></select>
						</div>
					</div>
				</div>

			</div>
		</div>
	</div>
</div>

<div class="ibox float-e-margins">
	<div class="ibox-title">
		<h5>提示方式</h5>
		<!--<div ibox-tools></div>-->
	</div>
	<div class="ibox-content">
		<div class="form-group">
			<label class="col-sm-2 control-label"></label>
			<div class="col-sm-8 checkbox ">
				<label ><input type="radio" checked="checked" name="winNoticeStatus" ng-model="noticeInfo.showStatus" value="0" ng-click="winNoticeStatusChange()" />非弹窗提示</label>
				<label ><input type="radio" name="winNoticeStatus" ng-model="noticeInfo.showStatus" value="1" ng-click="winNoticeStatusChange()"/>弹窗提示(仅一次)</label>
				<label ><input type="radio" name="winNoticeStatus" ng-model="noticeInfo.showStatus" value="2" ng-click="winNoticeStatusChange()"/>弹窗提示(每日一次)</label>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label"><i class="red_req">*</i>有效时间段：</label>
			<div class="col-sm-5">
				<input id="d5231" class="form-control" type="datetime" ng-model="noticeInfo.validBeginTime"  onchange=""  style="width:auto;display:inline-block;"
					   onFocus="var d5232=$dp.$('d5232');WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
				至
				<input id="d5232" class="form-control" type="datetime"  ng-model="noticeInfo.validEndTime"  onchange=""  style="width:auto;display:inline-block;"
					   onFocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'d5231\')}'})"/>
			</div>
		</div>
	</div>
</div>